package electricity.Enum;


//工单优先级枚举类
public enum RepairPriorityEnum {
    URGENT(1, "紧急"),
    NORMAL(2, "普通"),
    LOW(3, "低");

    private Integer code;
    private String desc;

    RepairPriorityEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // Getters
    public Integer getCode() { return code; }
    public String getDesc() { return desc; }
    // 自定义 valueOf 方法
    public static RepairPriorityEnum valueOf(Integer code) {
        if (code == null) {
            return null;
        }
        for (RepairPriorityEnum priority : values()) {
            if (priority.getCode().equals(code)) {
                return priority;
            }
        }
        throw new IllegalArgumentException("No matching RepairPriorityEnum for code: " + code);
    }
}
